how to make a javascript library